home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / other / dwarfx-tng / c / connected.amirx < prev    next >
Text File  |  1999-04-19  |  3KB  |  93 lines

  1. /* $VER: Connected.amirx 3.4 (21.5.98) Kuang Eleven 3 Init for AmIRC 2+
  2. */
  3. scrpath='T:' /* Path of events handlers*/
  4. /* Do not mess with anything below */
  5. options results
  6. 'SAY /RX _Connected.AMIRX'
  7. x=getclip('st_init')
  8. if x==1|x=2 then do
  9.     cecho(version() 'active')
  10.     exit
  11. end
  12. call setclip('st_init',2)
  13. cecho('Initializing')
  14. if ~show('L','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30,0) then do
  15.     cecho('Fatal Error: Cannot load rexxsupport.library')
  16.     exit
  17. end
  18. if ~show('L','rexxdossupport.library') then if ~addlib('rexxdossupport.library',0,-30,2) then do
  19.     cecho('Fatal Error: Cannot load rexxdossupport.library')
  20.     exit
  21. end
  22. if ~show('L','rexxkuang11.library') then if ~addlib("rexxkuang11.library",0,-30,0) then do
  23.     cecho('Fatal Error: Cannot load rexxkuang11.library')
  24.     exit
  25. end
  26. call KuangLibInit()
  27.  
  28. "GETPROGDIR"
  29. progdir=result
  30. if addpart(absolutepath(pragma('D')),'')~=addpart(absolutepath(progdir),'') then do
  31.     cecho('Initialization error!.If you are running AmIRC from a shell script,make sure to CD into the AmIRC directory first!')
  32.     exit
  33. end
  34. putscript('kuang11.amirx')
  35. conf='Kuang11/Config'
  36. if open(1,conf,'R') then do
  37.     buffer=readch(1,word(statef(conf),2))
  38.     cr='0a'x
  39.     do until buffer=''
  40.         parse var buffer c a (cr) buffer
  41.         if a~='' then call setclip('sc_'||lower(strip(c)),strip(a))
  42.     end
  43.     close(1)
  44.     ou='SAY /HILITE'
  45.     x=getclip('sc_comprefix')
  46.     if x~='' then ou '"'||x||'"'
  47.     l=getclip('sc_swords')
  48.     if getclip('sc_shit')='ON'&l~='' then do i=1 to words(l);;ou '"'upper(word(l,i))'"';end
  49.     "ISCONNECTED"
  50.     if rc=0 then do
  51.         if getclip('sc_asound')='ON' then do
  52.             "GETMYNICK"
  53.             x=result
  54.             ou '"!'||x||'"'
  55.             call setclip('st_asoundnick',x)
  56.         end
  57.         if getclip('sc_tia')='ON' then do
  58.             "GETMYNICK"
  59.             "USERHOST" result
  60.             host=result
  61.             open(1,'env:TIADCC','W')
  62.             rv=writeln(1,substr(host,pos('@',host)+1) 9050 9051 9052 9053)
  63.             close(1)
  64.         end
  65.     end
  66.     putlst=getclip('sc_copyscripts')
  67.     if putlst~='' then do until putlst=''
  68.         parse var putlst scr putlst
  69.         putscript(scr)
  70.     end
  71. end
  72. else cecho('Warning : Cannot load Configuration' conf)
  73.  
  74. call setclip('st_version',version())
  75. call setclip('st_init',1)
  76. cecho(version() 'Initialized')
  77. 'SAY /RX awayback SHOWLOG'
  78. exit
  79.  
  80. putscript:
  81. evn=scrpath||arg(1)
  82. if exists(evn) then address command 'delete' evn 'force quiet'
  83. address command 'copy rexx/'arg(1) evn 'quiet'
  84. address command 'protect' evn '-d'
  85. if ~exists(evn) then do
  86.     cecho('Failed! Missing' evn)
  87.     call setclip('st_init')
  88.     exit
  89. end
  90. return 0
  91. version:;return x2c(2)'Kuang Eleven'x2c(2) 'v3.0 Gamma (17)'
  92. cecho:;"ECHO P="d2c(27)"b«KInit»" arg(1)'.';return 0
  93.